//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2010, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093        **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************

//**********************************************************************
// $Header: /Alaska/Tools/template.c 6     1/13/10 2:13p Felixp $
//
// $Revision: 6 $
//
// $Date: 1/13/10 2:13p $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/Tools/template.c $
// 
// 6     1/13/10 2:13p Felixp
// 
//**********************************************************************
//<AMI_FHDR_START>
//
// Name:  <This File's Name>
//
// Description:	
//
//<AMI_FHDR_END>
//**********************************************************************

#include <AmiDxeLib.h>

// {323f7f42-11d5-44e2-8179-fd779a03b1e7} 
#define gOEM_DXE_GUID \
  { \
    0x323f7f42, 0x11d5, 0x44e2, {0x81, 0x79, 0xfd, 0x77, 0x9a, 0x3, 0xb1, 0xe7} \
  }
EFI_GUID  gOemDxeGuid = gOEM_DXE_GUID;

typedef UINT8 (EFIAPI *OEM_DXE_READ)(
        IN UINT8  Data
);
typedef UINT8 (EFIAPI *OEM_DXE_WRITE)(
        IN UINT8 Address,
        IN UINT8  Data
);
typedef struct _OEM_DXE_ACCESS{
    OEM_DXE_READ   Read;
    OEM_DXE_WRITE  Write;
};
typedef struct _OEM_DXE_ACCESS OEM_DXE_ACCESS;

UINT8 Read(UINT8 Address){
    UINT8 Data;
    IoWrite8(0x70,Address);
    Data =IoRead8(0x71);
    return 0;
}

UINT8 Write(UINT8 Address,UINT8 Data)
{
  IoWrite8(0x70,Address);
  IoWrite8(0x71,Data);
  return 0;
}
OEM_DXE_ACCESS OEM_DXE_Protocol={
        Read,
        Write     
};

EFI_STATUS OemDxeEntryPoint(
    IN EFI_HANDLE ImageHandle,
    IN EFI_SYSTEM_TABLE *SystemTable
)
{
    EFI_STATUS    Status;
    EFI_HANDLE      Handle=NULL;
    InitAmiLib(ImageHandle,SystemTable);
    
    Status = pBS->InstallMultipleProtocolInterfaces(
                    &Handle,
                    &gOemDxeGuid, 
                    &OEM_DXE_Protocol,
                    NULL
                    );
    if (Status =EFI_SUCCESS){
     //TODO
    }
    return EFI_SUCCESS;
 
}
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2010, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093        **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************
